<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>closure</title>
</head>
<body>
  <script>
    // Math.pow(4,2)
    // Math.pow(5,2)

    function makePower(power) {
      return function(num) {
        return Math.pow(num, power)
      }
    }

    let powerTwo = makePower(2)
    let powerThree = makePower(3)

    console.log(powerTwo(4))
    console.log(powerTwo(5))
    console.log(powerThree(4))
    console.log(powerThree(5))


  </script>
</body>
</html>